<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title></title>
		<link href="css/index.css" rel="stylesheet" />
	</head>
	<body>
	<div class="wrapIndex">
		<div class="headTitle">
		<img src="./img/leftArrow.jpg" />
		<p>电子发票</p>
       </div>
		<ul>
			<li class="kaipiao">
				<img class="imgIcon" src="./img/icon1.png" />
				<span>开具发票</span>
				<img class="rightArrow" src="./img/rightArrow.jpg" />
			</li>
			<li class="gotoHistory">
				<img class="imgIcon" src="./img/icon2.png" />
				<span>开票历史</span>
				<img class="rightArrow" src="./img/rightArrow.jpg" />
			</li>
			<li>
				<img class="imgIcon" src="./img/icon3.png" />
				<span>开票说明</span>
				<img class="rightArrow" src="./img/rightArrow.jpg" />
			</li>
			<li class="headManage">
				<img class="imgIcon" src="./img/icon4.png" />
				<span>发票抬头管理</span>
				<img class="rightArrow" src="./img/rightArrow.jpg" />
			</li>
		</ul>
		<div  class="divLi" style="margin-top: 0.3rem;">
			<img class="imgIcon" src="./img/icon5.png" />
			<span>绑定合肥通</span>
			<img class="rightArrow" src="./img/rightArrow.jpg" />
		</div>
		<span class="warnSpan">*只能对绑定的合肥通卡开具发票，申请前请确定是否已绑定合肥通</span>
		
		
		
			<div class="wrapBomb" style="display: none;">
			<div class="bombContent">
				<span class="spanTitle">提示！</span>
				<p class="pContent"><span class="spanContent1">您还未进行实名认证，请先进行实名认证</span></p>
				<button class="sure oneBtnClass">确定</button>
			</div>
			</div>
	</div>    
<script type="text/javascript" src="js/jquery.min.js" ></script>
<script type="text/javascript" src="js/code.js" ></script>
<script type="text/javascript" src="js/security.js" ></script>
<script>
	var ipconfig = 'http://36.32.24.54:8080/hft-server/interface4mobile';
	//var ipconfig = 'http://36.32.24.54:8080/hft-web/publicpay/tagTest';
	var login_name = window.location.href.split('?')[1].split('&')[0].split('=')[1];
	var telphone = window.location.href.split('?')[1].split('&')[1].split('=')[1];
	var orgcode = window.location.href.split('?')[1].split('&')[2].split('=')[1];
	sessionStorage.setItem('ipconfig',ipconfig);
	sessionStorage.setItem('login_name',login_name);
	sessionStorage.setItem('telphone',telphone);
	sessionStorage.setItem('orgcode',orgcode);
//	var orgcode = '100000211000001';
//	sessionStorage.setItem('login_name','15071437105HL');
//	sessionStorage.setItem('telphone','15071437105');
	$('.kaipiao').click(function(){
		window.location.href = './Invoice.html';
	})
	$('.gotoHistory').click(function(){
		window.location.href = './history.html';
	})
	$('.headManage').click(function(){
		window.location.href = './ticketInfo.html';
	})
	
	
			$.ajax({
				type:"post",
				url:sessionStorage.getItem('ipconfig'),
				data:JSON.stringify({data:encryptByDESModeEBC(JSON.stringify({"tag": "9001", 'login_name': login_name, 'mobilephone': telphone, 'realname': 'N','orgcode':orgcode  }))}),
				contentType: "application/json;charset=utf-8",
				success:function(data){
					console.log(data);
					if(data.result=='01'){
						$('.wrapBomb').show();
					}else{
						var custinfo =JSON.parse(data.custinfo);
						var idno = custinfo.idno;
						var idtype = custinfo.idtype;
						var name = custinfo.name;
						sessionStorage.setItem('idno',idno);
						sessionStorage.setItem('idtype',idtype);
						sessionStorage.setItem('name',name);
						$('.divLi').click(function(){
							window.location.href = './cardList.html';
							//window.location.href = './cardList.html?idno='+idno+'&idtype='+idtype+'&name='+name;
						})
					}
				}
			});
			
			$('.oneBtnClass').click(function(){
				$('.wrapBomb').hide();
			})
</script>

</body>
</html>
